home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
rsxwdk2s.zip
/
RSXWDK
/
LIBSRC
/
DOS
/
DOS3C.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-12-17
|
480b
|
29 lines
#include <errno.h>
#include <sys/doscalls.h>
/*
** AH = 0x3C
** CX = attr
** DS:DX = name
** return: AX fileno
*/
int dos_creat(const char *name, int attr)
{
struct REGPACK r;
struct SEGPACK sr = { GetDS(), GetES()};
r.eax = 0x3C00;
r.ecx = attr;
SET_SEG_OFF(name, sr.ds, r.edx);
_intxr(0x21, &r, &sr);
if (r.eflags & 1) {
_sys_doserror2errno( r.eax & 0xFFFF);
return (-1);
}
else
return (r.eax & 0xFFFF);
}